//logs.js
const util = require('../../utils/util.js')
const { $Toast } = require('../../dist/base/index');
var api = require('../../config/api.js');
const app = getApp();

Page({
  data: {

    loading:false,
    
    num:'',

    /*表单参数*/
  },
  onLoad: function () {
    util.request(api.GetSolicitNew, {
    }, 'POST').then(res => {
      if (res.success) {
        this.setData({
          num: res.data
        });
      }
    }).catch(err => {
    });
  },

  review(e){
    let state = e.currentTarget.dataset.state
    util.request(`${api.ReviewSolicitNew}?state=${state}`, {
    }, 'POST').then(res => {
      if (res.success) {
        if (state == 1){
          wx.redirectTo({
            url: `../../pages/my-datainput/my-datainput`,
          })
        }else {
          wx.navigateBack();
        }
      }
    }).catch(err => {
    });
  }

})
